import { instance } from './index'
const $api = {
  getUsers() {
    return instance({
      url: '/users',
      method: 'get',
    })
  },
  postLogin(body) {
    return instance({
      url: '/login',
      method: 'post',
      data: body,
    })
  },
  addEvent(body) {
    return instance({
      url: '/event',
      method: 'post',
      data: body,
    })
  },
  ignoreEvent(id) {
    return instance({
      url: `/event/${id}`,
      method: 'delete',
    })
  },
  getEvent(body) {
    return instance({
      url: '/event/get',
      method: 'post',
      data: body,
    })
  },
  changeEvent(body) {
    return instance({
      url: '/event',
      method: 'put',
      data: body,
    })
  },
  getNotice(body) {
    return instance({
      url: '/notice',
      method: 'post',
      data: body,
    })
  },
  publishNotice(body) {
    return instance({
      url: '/notice/publish',
      method: 'post',
      data: body,
    })
  },
  deleteNotice(id) {
    return instance({
      url: `/notice/${id}`,
      method: 'delete',
    })
  },
  registerUser(body) {
    return instance({
      url: 'users/commonuser',
      method: 'post',
      data: body,
    })
  },
  exitStatus(id) {
    return instance({
      url: `/login/${id}`,
      method: 'put',
    })
  },
  requestOther(id) {
    return instance({
      url: `/login/${id}`,
      method: 'get',
    })
  },
  changePassword(body) {
    return instance({
      url: '/login/password',
      method: 'post',
      data: body,
    })
  },
}
export default $api
